package com.zsrt.day20170411.pm;

import static org.junit.Assert.*;

import java.util.Scanner;

import org.junit.Test;

/**
*@author jzh
*@创建时间 2017年4月11日下午4:59:45
*类说明：
*/
public class StudentTest {
	
	@Test
	public void studentTest() throws Exception {
		Student s1=new Student();
		
		Scanner in=new Scanner(System.in);
		System.out.println("输入身份证号码：");
		String idCard = in.next();
		if(idCard.length()==18){
			System.out.println("输入正确，身份证号码已赋值");
			s1.setIdCard(idCard);
		}else{
			System.out.println("身份证号码输入错误");
			return;
		}
		
		System.out.println("输入名字：");
		String name = in.next();
		if(name.length()>=2&&name.length()<=4){
			System.out.println("输入正确，名字已赋值");
			s1.setName(name);
		}else{
			System.out.println("名字输入错误");
			return;
		}
		
		System.out.println("输入年龄：");
		int age = in.nextInt();
		if(age>=0&&age<=120){
			System.out.println("输入正确，年龄已赋值");
			s1.setAge(age);
		}else{
			System.out.println("年龄输入错误");
			return;
		}
		
		System.out.println("输入分数,double类型的：");
		double score = in.nextDouble();
		if(score>=0.0&&score<=100.0){
			System.out.println("输入正确，分数已赋值");
			s1.setScore(score);
		}else{
			System.out.println("分数输入错误");
			return;
		}
		
		System.out.println("输入性别：");
		String sex=in.next();
		if(sex.equals("男")||sex.equals("女")){
			System.out.println("输入正确，性别已赋值");
			s1.setSex(sex);
		}else{
			System.out.println("性别输入错误");
			return;
		}
		System.out.println("您本人的信息是：");
		System.out.println(s1.toString());;
	}
	

}
